package com.zhexinit.proxy.dao;

import java.util.Iterator;
import java.util.List;

import org.jsbd.boss.common.BusType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.zhexinit.proxy.domain.HttpProxyLog;

import edu.hziee.common.dbroute.BaseDAO;
import edu.hziee.common.queue.IBatchExecutor;

public class HttpProxyLogDao extends BaseDAO implements IBatchExecutor<HttpProxyLog> {
	public static final Logger LOGGER = LoggerFactory.getLogger(HttpProxyLogDao.class);

	@Override
	public void execute(List<HttpProxyLog> records) {
		Iterator<HttpProxyLog> it=records.iterator();
		while(it.hasNext()){
			HttpProxyLog log=it.next();
			if(!(log.getHttpContext().getBizType().indexOf(BusType.AD_CHANNEL_GETREPORTSHOW.getMessage())>-1||log.getHttpContext().getBizType().indexOf(BusType.AD_CHANNEL_GETADJSON.getMessage())>-1||log.getHttpContext().getBizType().indexOf(BusType.HM_CHANNEL_DOWNLOADAPK.getMessage())>-1)){
				it.remove();
			}
		}
		
		super.batchInsert("INSERT_INTO_HTTP_PROXY_LOG", records);
	}
}
